home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Logiciels PC 7
/
logiciel pc 7.iso
/
Linux
/
KDE_1.1pr2_Rpm
/
kdesupport-1.1pre2-1rh5x.i386.rpm
/
kdesupport-1.1pre2.1rh5x.cpio.gz
/
kdesupport-1.1pre2.1rh5x.cpio
/
opt
/
kde
/
bin
/
kdm_on
< prev
next >
Wrap
Text File
|
1999-01-27
|
2KB
|
70 lines
#!/bin/bash
# script for replacing xdm with kdm as the runlevel 5 Display Manager
# on RedHat 5.x Linux (modifies /etc/inittab)
# also modifies /etc/X11/xdm/Xsetup_0 to use the kdmdesktop
if [ "$KDEDIR" = "" ] ; then
echo "\"kdm_on\" cannot run because \$KDEDIR is not set:"
echo "(Log in again as root, and try again)"
exit
fi
INITTAB="/etc/inittab"
XSETUP="/etc/X11/xdm/Xsetup_0"
KDM="$KDEDIR/bin/kdm"
echo "Configuring the KDE X Display Manager (kdm) to replace xdm"
echo "($INITTAB and $XSETUP will be modified)"
if ! [ -f $INITTAB ] ; then
echo "error: $INITTAB does not exist: exiting"
exit
fi
if ! [ -f $XSETUP ] ; then
echo "error: $XSETUP does not exist: exiting"
exit
fi
if ! [ -f $KDM ] ; then
echo "error: $KDM does not appear to exist; exiting"
echo "(is the correct kdebase rpm installed?)"
exit
fi
if ! cp -pf $INITTAB $INITTAB.tmp ; then
echo 'error: "kdm_on" must be run as root: exiting'
exit
fi
cp -pf $XSETUP $XSETUP.tmp
# make modified inittab
# (just using $XSETUP.tmp for a temporary file in processing $INITTAB.)
sed -e "/kdm/d" $INITTAB > $XSETUP.tmp
sed -e "s/^x:5:respawn:/\#x:5:respawn:/g" $XSETUP.tmp > $INITTAB.tmp
echo "x:5:respawn:/usr/bin/env KDEDIR=$KDEDIR $KDEDIR/bin/kdm -nodaemon" >> $INITTAB.tmp
# make modified Xsetup_0
sed -e "/kdmdesktop/d" $XSETUP > $XSETUP.tmp
echo "$KDEDIR/bin/kdmdesktop" >> $XSETUP.tmp
echo "saving old $XSETUP as $XSETUP.kdesave"
mv -f $XSETUP $XSETUP.kdesave
mv -f $XSETUP.tmp $XSETUP
echo "saving old $INITTAB as $INITTAB.kdesave"
mv -f $INITTAB $INITTAB.kdesave
mv -f $INITTAB.tmp $INITTAB
echo "The runlevel-5 X Display Manager will now be kdm"
echo 'To restart runlevel 5 using kdm, type "telinit 3 ; telinit 5" '
echo 'To restore the RedHat default X Display Mananger (xdm), type "kdm_off"'